<?php
     /**************************************************************************************
     * Bookswapp is a web application which allow students to exchange their textbooks
     * It is developed by students of ITE "C. Colamonico" - Sistemi Informativi Aziendali
     * Acquaviva delle Fonti (BA) - Italy
     *
     * Bookswapp is free software; you can redistribute it and/or modify it under
     * the terms of the GNU Affero General Public License version 3 as published by the
     * Free Software Foundation
     *
     * Bookswapp is distributed in the hope that it will be useful, but WITHOUT
     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
     * FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more
     * details.
     *
     * You should have received a copy of the GNU Affero General Public License along 
     * with this program; if not, see http://www.gnu.org/licenses or write to the Free
     * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
     * 02110-1301 USA.
     *
     * You can contact ITE "C. Colamonico" with a mailing address at Via Colamonico, 5 
     * 70021 - Acquaviva delle Fonti (BA) Italy, or at email address bookswapp@itccolamonico.it.
     *
     * The interactive user interfaces in original and modified versions
     * of this program must display Appropriate Legal Notices, as required under
     * Section 5 of the GNU Affero General Public License version 3.
     *
     * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
     * these Appropriate Legal Notices must retain the display of the Bookswapp
     * logo and ITE "C. Colamonico" copyright notice. If the display of the logo is not reasonably
     * feasible for technical reasons, the Appropriate Legal Notices must display the words
     * "Copyright ITE C. Colamonico - http://www.itccolamonico.it - 2014. All rights reserved".
     ****************************************************************************************/
?>

<?php

$this->breadcrumbs = array(
	$model->label(2) => array('index'),
	GxHtml::valueEx($model),
);

$this->menu=array(
	array('label'=>Yii::t('app', 'List') . ' ' . $model->label(2), 'url'=>array('index')),
	array('label'=>Yii::t('app', 'Create') . ' ' . $model->label(), 'url'=>array('create')),
	array('label'=>Yii::t('app', 'Update') . ' ' . $model->label(), 'url'=>array('update', 'id' => $model->id_swap)),
	array('label'=>Yii::t('app', 'Delete') . ' ' . $model->label(), 'url'=>'#', 'linkOptions' => array('submit' => array('delete', 'id' => $model->id_swap), 'confirm'=>'Are you sure you want to delete this item?')),
	array('label'=>Yii::t('app', 'Manage') . ' ' . $model->label(2), 'url'=>array('admin')),
);
?>

<h1><?php echo Yii::t('app', 'View') . ' ' . GxHtml::encode($model->label()) . ' ' . GxHtml::encode(GxHtml::valueEx($model)); ?></h1>

<?php $this->widget('bootstrap.widgets.TbDetailView', array(
	'data' => $model,
	'attributes' => array(
'id_swap',
array(
			'name' => 'sellerUser',
			'type' => 'raw',
			'value' => $model->sellerUser !== null ? GxHtml::link(GxHtml::encode(GxHtml::valueEx($model->sellerUser)), array('user/view', 'id' => GxActiveRecord::extractPkValue($model->sellerUser, true))) : null,
			),
array(
			'name' => 'buyerUser',
			'type' => 'raw',
			'value' => $model->buyerUser !== null ? GxHtml::link(GxHtml::encode(GxHtml::valueEx($model->buyerUser)), array('user/view', 'id' => GxActiveRecord::extractPkValue($model->buyerUser, true))) : null,
			),
'price_swap',
'annexes_swap:boolean',
'sold:boolean',
'note_swap',
'date_for_sale',
'date_swap',
array(
			'name' => 'book',
			'type' => 'raw',
			'value' => $model->book !== null ? GxHtml::link(GxHtml::encode(GxHtml::valueEx($model->book)), array('book/view', 'id' => GxActiveRecord::extractPkValue($model->book, true))) : null,
			),
array(
			'name' => 'condition',
			'type' => 'raw',
			'value' => $model->condition !== null ? GxHtml::link(GxHtml::encode(GxHtml::valueEx($model->condition)), array('condition/view', 'id' => GxActiveRecord::extractPkValue($model->condition, true))) : null,
			),
	),
)); ?>

